using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using WozLib.UI.Ink.SketchObjects;

namespace WozLib.UI.Ink.SketchProperties
{
  public class FontSizeSketchProperty : SketchProperty
  {

    [XmlAttribute("Data")]
    public double Data
    {
      get
      {
        return _Data;
      }
      set
      {
        _Data = value;

        FirePropertyChanged("Data");
        NotifyPropertyChanged();
      }

    } private double _Data;

    public FontSizeSketchProperty(double data, WozPropertyType wozPropertyType)
      : base(wozPropertyType)
    {
      Data = data;
    }

    public FontSizeSketchProperty()
    {
    }

    public override object Clone()
    {
      return new FontSizeSketchProperty(Data, this.WozPropertyType);
    }

    /// <summary>
    /// Returns true if .equals on the string Data is true
    /// </summary>
    /// <param name="obj"></param>
    /// <returns></returns>
    public override bool Equals(object obj)
    {
      if (obj is FontSizeSketchProperty && (obj as FontSizeSketchProperty).Data == Data)
      {
        return true;
      }
      else
      {
        return false;
      }
    }

    public override CascadingProperty CreateCascadingProperty(List<ISketchObject> iWozObjects)
    {
      return new FontSizeCascadingProperty(iWozObjects, this);
    }
  }
}
